<?php

namespace app\api\controller;

use app\common\controller\Api;
use think\Config;
use think\Exception;

class CasesType extends Api
{
    protected $noNeedLogin = [];
    protected $noNeedRight = '*';

    protected $failException = true;

    public function _initialize()
    {
        parent::_initialize();
        $this->model = new \app\admin\model\cases\Ctype();

        if (!Config::get('fastadmin.usercenter')) {
            $this->error(__('User center already closed'));
        }
    }

    /**
     * 案件列表
     * @return void
     */
    public function list(){
        try {
           $data = $this->model->order('id desc')->select();
           $this->success('ok',$data);
        }catch (Exception $e){
            $this->error($e->getMessage());
        }
    }

}